import { createRouter, createWebHashHistory } from "vue-router";
import Home from "../components/Home.vue";
import Login from "../view/Login.vue";
const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: "/",
      name: "home",
      meta: {
        title: "首页",
      },
      component: Home,
      redirect: "/welcome",
      children: [
        {
          path: "/welcome",
          name: "welcome",
          meta: {
            title: "欢迎页",
          },
          component: () => import("./../view/Welcome.vue"),
        },
        {
          path: "/system/user",
          name: "用户管理",
          meta: {
            title: "用户管理",
          },
          component: () => import("./../view/User.vue"),
        },
        {
          path: "/system/Menu",
          name: "菜单管理",
          meta: {
            title: "菜单管理",
          },
          component: () => import("./../view/Menu.vue"),
        },
        {
          path: "/system/role",
          name: "角色管理",
          meta: {
            title: "角色管理",
          },
          component: () => import("./../view/Role.vue"),
        },
        {
          path: "/system/dept",
          name: "部门管理",
          meta: {
            title: "部门管理",
          },
          component: () => import("./../view/Dept.vue"),
        },
      ],
    },
    {
      path: "/login",
      name: "login",
      meta: {
        title: "登录页",
      },
      component: Login,
    },
  ],
});
export default router;
